//
//  BookingTableViewCell.m
//  TourPlay
//
//  Created by dllo on 15/11/26.
//  Copyright © 2015年 王军岐. All rights reserved.
//

#import "BookingTableViewCell.h"

@interface BookingTableViewCell ()

@property (nonatomic, retain) UILabel *titleL;
@property (nonatomic, retain) UIButton *myButton;

@end


@implementation BookingTableViewCell
- (void)dealloc
{
    [_titleL release];
    [_myButton release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews
{
    
    self.titleL = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 50.f * AUTOSCREEN_HEIGHT)];
    self.titleL.text = @"我的订阅";
    self.titleL.textAlignment = NSTextAlignmentCenter;
    self.titleL.font = [UIFont systemFontOfSize:18.f];
    self.titleL.textColor = [UIColor colorWithRed:0.4 green:0.35 blue:0.36 alpha:1];
    [self.contentView addSubview:self.titleL];
    [_titleL release];
    
    self.myButton = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.myButton.backgroundColor = [UIColor yellowColor];
    self.myButton.frame = CGRectMake(SCREEN_WIDTH - (50 + 18) * AUTOSCREEN_WIDTH, 0, 60 * AUTOSCREEN_WIDTH, 50 * AUTOSCREEN_HEIGHT);
    [self.myButton setTitle:@"修改" forState:UIControlStateNormal];
    [self.myButton setTitleColor:[UIColor colorWithRed:0.95 green:0.55 blue:0.18 alpha:1] forState:UIControlStateNormal];
    self.myButton.titleLabel.font = [UIFont systemFontOfSize:17.f * AUTOSCREEN_WIDTH];
    [self.myButton addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.myButton];
    
    
}
- (void)buttonAction
{
    [self.delegate goToChooseType];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
